home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Filezilla Server / FileZilla_Server-0_9_41.exe / source / interface / OptionsSecurityPage.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2011-11-06  |  3.5 KB  |  112 lines

  1. // FileZilla Server - a Windows ftp server
  2.  
  3. // Copyright (C) 2002-2004 - Tim Kosse <tim.kosse@gmx.de>
  4.  
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9.  
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14.  
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. // OptionsSecurityPage.cpp: Implementierungsdatei
  20. //
  21.  
  22. #include "stdafx.h"
  23. #include "filezilla server.h"
  24. #include "OptionsDlg.h"
  25. #include "OptionsPage.h"
  26. #include "OptionsSecurityPage.h"
  27.  
  28. #if defined(_DEBUG) && !defined(MMGR)
  29. #define new DEBUG_NEW
  30. #undef THIS_FILE
  31. static char THIS_FILE[] = __FILE__;
  32. #endif
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // Dialogfeld COptionsSecurityPage 
  36.  
  37.  
  38. COptionsSecurityPage::COptionsSecurityPage(COptionsDlg *pOptionsDlg, CWnd* pParent /*=NULL*/)
  39.     : COptionsPage(pOptionsDlg, COptionsSecurityPage::IDD, pParent)
  40. {
  41.     //{{AFX_DATA_INIT(COptionsSecurityPage)
  42.     m_bInFxp = FALSE;
  43.     m_bInFxpStrict = FALSE;
  44.     m_bOutFxp = FALSE;
  45.     m_bOutFxpStrict = FALSE;
  46.     //}}AFX_DATA_INIT
  47. }
  48.  
  49.  
  50. void COptionsSecurityPage::DoDataExchange(CDataExchange* pDX)
  51. {
  52.     COptionsPage::DoDataExchange(pDX);
  53.     //{{AFX_DATA_MAP(COptionsSecurityPage)
  54.     DDX_Control(pDX, IDC_OUTFXPSTRICT, m_cOutFxpStrict);
  55.     DDX_Control(pDX, IDC_INFXPSTRICT, m_cInFxpStrict);
  56.     DDX_Check(pDX, IDC_INFXP, m_bInFxp);
  57.     DDX_Check(pDX, IDC_INFXPSTRICT, m_bInFxpStrict);
  58.     DDX_Check(pDX, IDC_OUTFXP, m_bOutFxp);
  59.     DDX_Check(pDX, IDC_OUTFXPSTRICT, m_bOutFxpStrict);
  60.     //}}AFX_DATA_MAP
  61. }
  62.  
  63.  
  64. BEGIN_MESSAGE_MAP(COptionsSecurityPage, COptionsPage)
  65.     //{{AFX_MSG_MAP(COptionsSecurityPage)
  66.     ON_BN_CLICKED(IDC_INFXP, OnInfxp)
  67.     ON_BN_CLICKED(IDC_OUTFXP, OnOutfxp)
  68.     //}}AFX_MSG_MAP
  69. END_MESSAGE_MAP()
  70.  
  71. /////////////////////////////////////////////////////////////////////////////
  72. // Behandlungsroutinen fⁿr Nachrichten COptionsSecurityPage 
  73.  
  74. void COptionsSecurityPage::OnInfxp() 
  75. {
  76.     UpdateData(TRUE);
  77.     m_cInFxpStrict.EnableWindow(m_bInFxp);
  78.     
  79. }
  80.  
  81. void COptionsSecurityPage::OnOutfxp() 
  82. {
  83.     UpdateData(TRUE);
  84.     m_cOutFxpStrict.EnableWindow(m_bOutFxp);        
  85. }
  86.  
  87. BOOL COptionsSecurityPage::OnInitDialog() 
  88. {
  89.     COptionsPage::OnInitDialog();
  90.     
  91.     m_cInFxpStrict.EnableWindow(m_bInFxp);
  92.     m_cOutFxpStrict.EnableWindow(m_bOutFxp);
  93.     
  94.     return TRUE;  // return TRUE unless you set the focus to a control
  95.                   // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurⁿckgeben
  96. }
  97.  
  98. void COptionsSecurityPage::LoadData()
  99. {
  100.     m_bInFxp = !m_pOptionsDlg->GetOptionVal(OPTION_INFXP);
  101.     m_bOutFxp = !m_pOptionsDlg->GetOptionVal(OPTION_OUTFXP);
  102.     m_bInFxpStrict = m_pOptionsDlg->GetOptionVal(OPTION_NOINFXPSTRICT) != 0;
  103.     m_bOutFxpStrict = m_pOptionsDlg->GetOptionVal(OPTION_NOOUTFXPSTRICT) != 0;
  104. }
  105.  
  106. void COptionsSecurityPage::SaveData()
  107. {
  108.     m_pOptionsDlg->SetOption(OPTION_INFXP, !m_bInFxp);
  109.     m_pOptionsDlg->SetOption(OPTION_OUTFXP, !m_bOutFxp);
  110.     m_pOptionsDlg->SetOption(OPTION_NOINFXPSTRICT, m_bInFxpStrict);
  111.     m_pOptionsDlg->SetOption(OPTION_NOOUTFXPSTRICT, m_bOutFxpStrict);
  112. }